import request from '@/utils/request'

// @Summary 获取渠道列表
// @Success 200 {string} json "{"code":0,"msg":""}"
// @Router /api/channel/list [Post]
export const getChannelList = (data) => {
  return request({
    url: '/api/channel/list',
    method: 'Post',
    data
  })
}

// @Summary 全部渠道信息
// @Success 200 {string} json "{"code":0,"msg":""}"
// @Router /api/channel/all [get]
export const getChannelall = () => {
  return request({
    url: '/api/channel/all',
    method: 'Get'
  })
}

// @Summary 添加渠道
// @Success 200 {string} json "{"code":0,"msg":""}"
// @Router /api/channel/add [post]
export const addChannel = (data) => {
  return request({
    url: '/api/channel/add',
    method: 'Post',
    data
  })
}

// @Summary 编辑渠道
// @Success 200 {string} json "{"code":0,"msg":""}"
// @Router /api/channel/update [post]
export const updateChannel = (data) => {
  return request({
    url: '/api/channel/update',
    method: 'Post',
    data
  })
}

// @Summary 删除渠道
// @Success 200 {string} json "{"code":0,"msg":""}"
// @Router /api/channel/delete/{channelId} [get]
export const deleteChannel = (channelId) => {
  return request({
    url: `/api/channel/delete/${channelId}`,
    method: 'Get'
  })
}
export const getorderStat = (data) => {
  return request({
    url: '/api/channel/orderStat',
    method: 'Post',
    data
  })
}
export const getchannelusersList = (data) => {
  return request({
    url: '/api/channel/user/list',
    method: 'Post',
    data
  })
}
export const addchanneluser = (data) => {
  return request({
    url: '/api/channel/user/add',
    method: 'Post',
    data
  })
}
export const updatechanneluser = (data) => {
  return request({
    url: '/api/channel/user/update',
    method: 'Post',
    data
  })
}